package br.mil.eb.pqrmnt7.scc.entity;


import java.util.Date;

import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Access;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.AccessType;
import com.powerlogic.jcompany.commons.config.stereotypes.SPlcEntity;
import javax.persistence.Entity;
/**
 * Classe Concreta gerada a partir do assistente
 */
@SPlcEntity
@Entity
@Table(name="QUOTA_COMBUSTIVEL")
@SequenceGenerator(name="SE_QUOTA_COMBUSTIVEL", sequenceName="SE_QUOTA_COMBUSTIVEL")
@Access(AccessType.FIELD)

@NamedQueries({
	@NamedQuery( name="QuotaCombustivelEntity.queryMan", 
				query="from QuotaCombustivelEntity"),
	@NamedQuery( name="QuotaCombustivelEntity.querySel", 
				query="select obj.id as id, " +
							 "obj.dataFornecimento as dataFornecimento, " +
							 "obj1.id as tipoCombustivel_id, " +
							 "obj1.nome as tipoCombustivel_nome, " +
							 "obj2.id as fonteCombustivel_id, " +
							 "obj2.nome as fonteCombustivel_nome, " +
							 "obj.volume as volume, " +
							 "obj.descricao as descricao " +
						"from QuotaCombustivelEntity obj " +
							"left outer join obj.tipoCombustivel as obj1 " +
							"left outer join obj.fonteCombustivel as obj2 " +
						"order by obj.dataFornecimento asc"),
	@NamedQuery( name="QuotaCombustivelEntity.querySelLookup", 
				query="select id as id, " +
							 "descricao as descricao " +
						"from QuotaCombustivelEntity " +
						"where id = ? " +
						"order by dataFornecimento asc"),
	@NamedQuery( name="QuotaCombustivelEntity.recuperaPorPeriodo",
				query=" select q " +
						"from QuotaCombustivelEntity q " +
						"where q.dataFornecimento>=:dataInicio and " +
							  "q.dataFornecimento<=:dataFim " +
						"order by q.dataFornecimento asc")
})
public class QuotaCombustivelEntity extends QuotaCombustivel {

	private static final long serialVersionUID = 1L;
 	
    /*
     * Construtor padrao
     */
    public QuotaCombustivelEntity() {
    }
	@Override
	public String toString() {
		return getDescricao();
	}

}
